package com.hksj.ecm.controller;

import com.hksj.common.core.model.Rest;
import com.hksj.ecm.dto.EnergyFLowDTO;
import com.hksj.ecm.service.EnergyFLowService;
import com.hksj.ecm.vo.EnergyFLowChartVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zengke
 * @version 1.0
 * @see EnergyFlowController
 * @since 2024/8/9 10:56
 */


@Api(tags = "能耗监测-能耗流向图")
@RequestMapping("/api/energyFlow")
@RestController
public class EnergyFlowController {
    @Autowired
    private EnergyFLowService energyFLowService;


    @ApiOperation(value = "查询能源流向图")
    @PostMapping("/queryEnergyFLowChartList")
    public Rest<List<EnergyFLowChartVO>> queryEnergyFLowChartList(@RequestBody EnergyFLowDTO energyFLowDTO){
        List<EnergyFLowChartVO> energyFLowChartVOS = energyFLowService.queryEnergyFLowChartList(energyFLowDTO);
        return Rest.ok(energyFLowChartVOS);
    }
}
